/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MSP_H
#define __MSP_H



/* Exported macro ------------------------------------------------------------*/
/* Includes ------------------------------------------------------------------*/

#include "stm32f4xx.h"

/* Exported define -----------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
 #define MSP_Buf USART1_Buf//以后换了串口，只需要这里一改就行了
 
typedef enum
{
    MSP_Fun_RangeFinder=0x1F01,
    MSP_Fun_OpticalFlow,
}MSPFun_TypeDef;//MSP功能定义



typedef enum
{
    MSP_MsgType_Request,
    MSP_MsgType_Response,
    MSP_MsgType_Error,
}MSPMsgType_TypeDef;//信息种类定义

typedef struct
{
    uint8_t MSP_Version;
    MSPMsgType_TypeDef MSP_MsgType;
    uint8_t MSP_Flag;
    MSPFun_TypeDef MSP_Fun;
}MSP_DataTypeDef;

/* Exported functions --------------------------------------------------------*/
#include "Matek.h"//由于l0x里面用到了MSPFun_TypeDef这个枚举类型，如果写在前面的话就会识别不到


void MSP_Decode(uint32_t frameLen);
static ErrorStatus MSP_crc8_dvb_s2(uint32_t frameLen);


#endif



